package com.netty.websocket.common.enums;

/**
 * @ClassName: WsSubtype
 * @Description: socket订阅类型
 * @author yuyehong@cloudwalk.cn
 * @date 2020/4/309:10
 * @version V1.3.0
 * @since 1.8
 */
public enum WsSubTypeEnum {

	/**
	 * 连接类型1
	 */
	ONE(1, "连接类型1");

	private Integer key;
	private String value;

	WsSubTypeEnum(Integer key, String value) {
		this.key = key;
		this.value = value;
	}

	public Integer getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}

	public static WsSubTypeEnum getByKey(Integer key) {
		if (key == null) {
			return null;
		}
		for (WsSubTypeEnum subType : values()) {
			if (subType.getKey().equals(key)) {
				return subType;
			}
		}
		return null;
	}

}
